package com.sdyc.ndmp.cls.engine;

import com.sdyc.ndmp.cls.dtd.InputPath;

import java.util.List;

/**
 *  中文情感判断
 * Created by sssd on 2017/7/18.
 */
public class SentencePredcit {
    protected PredictModel predictModel;

    /**
     *  初始化
     * @param method  预测模型方式
     * @param inputPath  相关路径设置
     * @throws Exception
     */
    public void initTrain( int method, InputPath inputPath) throws Exception {
        predictModel =  PredictFactory.newInstance(method);
        predictModel.init(inputPath);
    }

    /**
     *   语句预测
     * @param sentecne   待预测语句
     * @return
     * @throws Exception
     */
    public List sensePredict(String sentecne)throws Exception{
        List preLabel = predictModel.predict(sentecne);
        return  preLabel;
    }

}
